<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link rel="stylesheet" href="assets/css/skins/table.css">
<style>
    .basicInfo input[type=radio]:checked+.text:before,
    .basicInfo input[type=checkbox]+.text:before, input[type=radio]+.text:before {
        border-radius: 100%;
    }
    input,select{
        height: 30px!important;
        border-radius: 5px!important;
    }
    .form-group input{
        border-radius: 5px!important;
    }
    .form-group textarea{
        border-radius: 5px!important;
    }
    .control-label{
        margin-bottom:0px!important;
        line-height: 30px!important;
    }
    .bootbox .modal-dialog {
        width: 60% !important;
    }
    .editForm>div {
        min-height: 40px;
    }
    .bootbox-expand-button {
        width: 19px;
        height: 19px;
        border: none;
        cursor: pointer;
        -webkit-appearance: none;
        float: right;
        top: 4px;
        left: -10px;
        position: relative;
        background: #E9F5FF url("assets/img/nav-img/icon_window.png") no-repeat 0 0;
    }
    .bootbox-close-button {
        width: 19px;
        height: 19px;
        border: none;
        cursor: pointer;
        -webkit-appearance: none;
        float: right;
        top: 4px;
        left: -5px;
        position: relative;
        background: #E9F5FF url("assets/img/nav-img/icon_close.png") no-repeat 0 0;
    }
    .expandView {
        width: 100%;
    }
    .has-feedback label{
        margin-bottom: 0px!important;
    }
    .tssStudentEditDialog .modal-body {
        padding-bottom: 0;
    }
</style>

<div class="row" style="margin-left: 0px!important;">
    <form class="editStudentForm" action="${saveUrl}" method="post" responseType="JSON" role="form" style="margin-bottom: 0px!important;"
          id="editForm_${serializeNum}"
          data-bv-submitButtons="#editFormSubmitBtn_${serializeNum}"
          data-bv-message="This value is not valid"
          data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
          data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
          data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
        <input type="hidden" name="id" value="${editEntity.id}">
        <#if memberType==1||memberType==2>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="form-group">
                        <label for="name"
                               class="col-sm-2 col-sm-offset-2 control-label no-padding-right">会员编号：</label>
                        <div class="col-sm-6">
                            <input data-bv-message="The field is not valid" size="12" name="number"
                                   alt="会员编号" id="number" placeholder="会员编号" type="text"
                                   title="会员编号"
                                   class="form-control" value="${editEntity.number}"/>
                            <span class="text"></span>
                        </div>
                    </div>
                </div>
            </#if>
        </#if>
        <div class="margin-bottom-10 margin-top-20"
             style="padding-left: 20px;line-height: 20px;font-size: 16px;color: #2679b8">基础信息
        </div>
        <div class="basicInfo" style="line-height: 20px!important;">
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label for="name" class="col-xs-4 col-md-4 col-lg-4 control-label text-align-right">
                                <span style="color: red">*</span>幼儿姓名：</label>
                            <div class="col-xs-8 col-md-8 col-lg-8 nopadding" style="max-width: 200px">
                                <input required="required" data-bv-message="请填写客户信息" name="name"
                                       alt="客户姓名" onkeyup="inputValueLength(this,'name')"
                                       id="name" placeholder="客户姓名" type="text" title="客户姓名"
                                       class="form-control"
                                       value="${editEntity.name}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label class="col-xs-4 col-md-4 col-lg-4 control-label text-align-right">幼儿昵称：</label>
                            <div class="col-xs-8 col-md-8 col-lg-8 nopadding" style="max-width: 200px">
                                <input data-bv-message="The field is not valid" name="nickName"
                                       alt="昵称" onkeyup="inputValueLength(this,'name')"
                                       id="nickName" placeholder="昵称" type="text" title="昵称"
                                       class="form-control"
                                       value="${editEntity.nickName}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden;">
                            <label class="col-xs-4 col-md-4 col-lg-4 control-label text-align-right">性别：</label>
                            <div class="col-xs-8 col-md-8 col-lg-8 nopadding" style="max-width: 150px">
                                <label>
                                    <input type="radio" name="sex" value="1" style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;" checked="true">
                                </label><label style="margin-right: 10px">男</label>
                                <label>
                                    <input type="radio" name="sex" value="2"  style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;">
                                </label>
                                <label>女</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden;">
                            <label for="birthdayDate"
                                   class="col-xs-4 col-md-4 col-lg-4 control-label text-align-right">出生日期：</label>
                            <div class="col-xs-8 col-md-8 col-lg-8 nopadding" style="max-width: 200px">
                                <span class="input-icon icon-left">
                                    <input data-bv-date-format="YYYY-MM-DD"
                                           data-bv-message="The field is not valid"
                                           data-bv-date-message="请正确输入一个时间" data-bv-date="false"
                                           name="birthdayDate" alt="出生日期" id="birthdayDate" placeholder="出生日期"
                                           type="text" title="出生日期"
                                           class="form-control form-control date-picker"
                                           onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd'})"
                                           value="${editEntity.birthdayDate}"/>
                                    <i class="fa fa-calendar"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </#if>

            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <#if relationList?size==0>
                    <div id="basicInfo">
                        <div class="col-xs-12 col-md-12 col-lg-12 circleHtml" style="margin-bottom: 15px!important;" id="circleHtml" >
                            <div class="form-group nomargin-bottom" >
                                <label for="contactPhone"
                                       class="col-xs-2 col-md-2 col-lg-2 control-label  text-align-right" style="padding-right: 7px!important;">
                                    <span style="color: red">*</span>家长姓名：</label>
                                <div>
                                    <label class="col-xs-10 col-md-10 col-lg-10 circleHtmlLabel nomargin-bottom " style="padding-left: 2px!important;">
                                        <label class="nomargin-bottom">
                                            <input required="required" data-bv-message="请填写家长姓名！" style="width: 200px"
                                                   alt="家长姓名" id="patriarchName" placeholder="家长姓名" type="text"
                                                   title="家长姓名" name="patriarchName" onkeyup="inputValueLength(this,'name')"
                                                   class="form-control patriarchName" value="${data.name}"/>
                                        </label>
                                        <label class="nomargin-bottom">
                                            <select name="affiliationRelation" class="affiliationRelation" style="width: 87px!important;">
                                                <@dictionary groupCode="affiliationRelation";dics>
                                                <#list dics as dic>
                                                    <option value="${dic.code}">${dic.value}</option>
                                                </#list>
                                            </@dictionary>
                                            </select>
                                        </label>
                                        <label class="nomargin-bottom">
                                            <input required="required" data-bv-message="请填写联系电话！" maxlength="11" style="width: 200px"
                                                   alt="联系电话" id="contactPhone" placeholder="联系电话" type="text"
                                                   title="联系电话" name="contactPhone"
                                                   class="form-control contactPhone"
                                                   value="${editEntity.contactPhone}"
                                                   data-bv-regexp="true"
                                                   data-bv-regexp-regexp="^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$"
                                                   data-bv-regexp-message="请输入正确的联系电话!"
                                                   onblur="checkPhoneIsSame(this)" />
                                        </label>
                                        <label class="nomargin-bottom">
                                            <select name="positionType" class="positionType">
                                                <@dictionary groupCode="positionType";dics>
                                                <#list dics as dic>
                                                    <option value="${dic.code}">${dic.value}</option>
                                                </#list>
                                            </@dictionary>
                                            </select>
                                        </label>
                                        <label class="nomargin-bottom padding-left-10">
                                            <div onclick="clickAdd()" style="width: 22px;height: 22px;background: url('assets/img/nav-img/icon_add.png');">
                                            </div>
                                        </label>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                </#if>
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden;">
                            <label for="weiChat" class="col-xs-4 col-md-4 col-lg-4 control-label text-align-right">微信号：</label>
                            <div class="col-xs-8 col-md-8 col-lg-8 nopadding" style="max-width: 200px">
                                <input data-bv-message="The field is not valid" name="weiChat"
                                       alt="微信号" onkeyup="inputValueLength(this,'WeChat')"
                                       id="weiChat" placeholder="微信号" type="text" title="微信号"
                                       class="form-control"
                                       value="${editEntity.weiChat}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                    <!--<input  name="age" value="${editEntity.age}">-->
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label for="telePhone" class="col-xs-4 col-md-4 col-lg-4 control-label text-align-right">固定电话：</label>
                            <div class="col-xs-8 col-md-8 col-lg-8 nopadding" style="max-width: 200px">
                                <input data-bv-message="The field is not valid" name="telePhone"
                                       alt="固定电话"
                                       id="telePhone" placeholder="固定电话" type="text" title="固定电话"
                                       class="form-control"
                                       onkeyup="inputValueLength(this,'telePhone')"
                                       value="${editEntity.telePhone}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12" style="margin-bottom: 15px!important;" >
                    <div class="form-group nomargin-bottom">
                        <label class="col-xs-2 col-md-2 col-lg-2 control-label  text-align-right" style="padding-right: 7px!important;">家庭住址：</label>
                        <div>
                            <label class="col-xs-10 col-md-10 col-lg-10 nomargin-bottom " style="padding-left: 2px!important;">
                                <label class="nomargin-bottom">
                                    <select name="addressProvince" class="addressProvince col-xs-12 col-md-12 col-lg-12 nopadding">
                                        <option value="">请选择</option>
                                        <@dictionary groupCode="addressProvince";dics>
                                        <#list dics as dic>
                                            <option value="${dic.code}">${dic.value}</option>
                                        </#list>
                                    </@dictionary>
                                    </select>
                                </label>
                                <label>
                                    省
                                </label>
                                <label class="nomargin-bottom">
                                    <select name="addressCity" class="addressCity col-xs-12 col-md-12 col-lg-12 nopadding">
                                        <option  value="">请选择</option>
                                    </select>
                                </label>
                                <label class="nomargin-bottom">
                                    <select name="addressRegion" class="addressRegion col-xs-12 col-md-12 col-lg-12 nopadding">
                                        <option  value="">请选择</option>
                                    </select>
                                </label>
                                <label>
                                    市/区
                                </label>
                                <label class="nomargin-bottom">
                                    <input data-bv-message="The field is not valid" style="max-width: 200px"
                                           name="familyAddress" onkeyup="inputValueLength(this,50)"
                                           alt="家庭住址" id="familyAddress" placeholder="家庭住址" type="text"
                                           title="家庭住址"
                                           class="form-control" value="${editEntity.familyAddress}"/>
                                </label>
                            </label>
                        </div>
                    </div>
                </div>
                <!--<div class="col-xs-12 col-md-12 col-lg-12 nopadding-left nopadding-right" >-->
                <!--<div class="form-group">-->
                <!--<label for="familyAddress"-->
                <!--class="col-sm-2 col-sm-offset-2 control-label no-padding-right">家庭住址：</label>-->
                <!--<div class="col-sm-6">-->
                <!--<input data-bv-message="The field is not valid" size="50"-->
                <!--name="familyAddress"-->
                <!--alt="家庭住址" id="familyAddress" placeholder="家庭住址" type="text"-->
                <!--title="家庭住址"-->
                <!--class="form-control" value="${editEntity.familyAddress}"/>-->
                <!--<span class="text"></span>-->
                <!--</div>-->
                <!--</div>-->
                <!--</div>-->
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="form-group">
                        <label for="contactPhone"
                               class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">备注：</label>
                        <div class="col-xs-8  nomargin-bottom " style="padding-left: 2px!important;">
                            <textarea class="form-control" name="remark" rows="3" onkeyup="inputValueLength(this,200)"
                                      style="resize:none"></textarea>
                        </div>
                    </div>
                </div>
            </#if>
        </div>

        <div class="margin-bottom-10 "
             style="padding-left: 20px;line-height: 20px;font-size: 16px;color: #2679b8">高级信息
        </div>
        <div class="ancedInfo">
            <div class="col-xs-12 col-md-12 col-lg-12">
                <#if (true && editModel=='add')||(true && editModel=='edit')>
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group">
                            <label class="col-xs-5 col-md-5 col-lg-5 control-label text-align-right">客户来源：</label>
                            <div class="col-xs-7 col-md-7 col-lg-7 nopadding" style="max-width: 150px">
                                <select name="channelSource" class="col-xs-12 col-md-12 col-lg-12 nopadding" style="padding-left: 7px!important;">
                                    <option value="">请选择</option>
                                    <@dictionary groupCode="channelSource";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                                </select>
                            </div>
                        </div>
                        <input type="hidden" name="channelRemark"/>
                    </div>
                </#if>
                <#if (true && editModel=='add')||(true && editModel=='edit')>
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden">
                            <label class="col-xs-5 col-md-5 col-lg-5 control-label text-align-right">需要程度：</label>
                            <div class="col-xs-7 col-md-7 col-lg-7 nopadding" style="max-width: 150px">
                                <select name="demanDegree" class="col-xs-12 col-md-12 col-lg-12">
                                    <option value="">请选择</option>
                                    <@dictionary groupCode="demanDegree";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                                </select>
                            </div>
                        </div>
                    </div>
                </#if>
            </div>

            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden">
                            <label for="characters" class="col-xs-5 col-md-5 col-lg-5 control-label text-align-right">宝宝性格：</label>
                            <div class="col-xs-7 col-md-7 col-lg-7 nopadding" style="max-width: 150px">
                                <input data-bv-message="The field is not valid" onkeyup="inputValueLength(this,20)" name="characters"
                                       alt="性格"
                                       id="characters" placeholder="性格" type="text" title="性格"
                                       class="form-control"
                                       value="${editEntity.characters}"/>
                                <span class="text"></span>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden">
                            <label class="col-xs-5 col-md-5 col-lg-5 control-label text-align-right">是否转介绍：</label>
                            <div class="col-xs-7 col-md-7 col-lg-7 nopadding" style="max-width: 150px">
                                <select name="isTurnIntroduce" class="col-xs-12 col-md-12 col-lg-12">
                                    <option value="" >请选择</option>
                                    <@dictionary groupCode="isTurnIntroduce";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                                </select>
                            </div>
                        </div>
                    </div>

                </div>
            </#if>
            <div class="col-xs-12 col-md-12 col-lg-12">
                <#if (true && editModel=='add')||(true && editModel=='edit')>
                    <div class="col-xs-6 col-md-6 col-lg-6">
                        <div class="form-group" style="overflow: hidden">
                            <label class="col-xs-5 col-md-5 col-lg-5 control-label text-align-right">调查问卷：</label>
                            <div class="col-xs-7 col-md-7 col-lg-7 nopadding" style="max-width: 150px">
                                <select name="isFinishQuestionnaire" class="col-xs-12 col-md-12 col-lg-12">
                                    <@dictionary groupCode="isFinishQuestionnaire";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                                </select>
                            </div>
                        </div>
                    </div>
                </#if>
                <#if (true && editModel=='add')||(true && editModel=='edit')>
                    <div class="col-xs-6 col-md-6 col-lg-6 nopadding">
                        <div class="form-group" style="overflow: hidden">
                            <label class="col-xs-5 col-md-5 col-lg-5 control-label text-align-right nopadding-left">是否参加过早教课程：</label>
                            <div class="col-xs-7 col-md-7 col-lg-7 nopadding" style="max-width: 150px">
                                <select name="isJoinEarlyEducationCourse" class="col-xs-12 col-md-12 col-lg-12">
                                    <option value="" >请选择</option>
                                    <@dictionary groupCode="isJoinEarlyEducationCourse";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                                </select>
                            </div>
                        </div>
                    </div>
                </#if>
            </div>

            <div class="col-xs-12 col-md-12 col-lg-12">
                <div class="form-group">
                    <label  class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">客户评估：</label>
                    <input type="hidden"  name="clientAssess">
                    <div>
                        <div class="col-xs-10  nomargin-bottom " style="padding-left: 2px!important;line-height: 28px">
                            <@dictionary groupCode="clientAssess";dics>
                                <#list dics as dic>
                                    <label>
                                        <input type="checkbox" name="clientAssessChk"  class="chk" value="${dic.code}" style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" >
                                    </label>
                                    <label style="margin-right: 10px" >${dic.value}</label>
                                </#list>
                            </@dictionary>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-md-12 col-lg-12" >
                <div class="form-group" >
                    <label  class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">入园方式：</label>
                    <input type="hidden"  name="joinSchoolWay">
                    <div>
                        <div class="col-xs-10  nomargin-bottom " style="padding-left: 2px!important;line-height: 28px">
                            <@dictionary groupCode="joinSchoolWay";dics>
                                <#list dics as dic>
                                    <label>
                                        <input type="checkbox" name="joinSchoolWayChk" class="chk" value="${dic.code}" style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" >
                                    </label>
                                    <label style="margin-right: 10px" >${dic.value}</label>
                                </#list>
                            </@dictionary>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-md-12 col-lg-12" >
                <div class="form-group" >
                    <label  class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">选择机构因素：</label>
                    <input type="hidden"  name="organizationElement">
                    <div>
                        <div class="col-xs-10  nomargin-bottom " style="padding-left: 2px!important;line-height: 28px">
                            <@dictionary groupCode="organizationElement";dics>
                                <#list dics as dic>
                                    <label>
                                        <label>
                                            <input type="checkbox" name="organizationElementChk" class="chk" value="${dic.code}" style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" >
                                        </label>
                                        <label style="margin-right: 10px" >${dic.value}</label>
                                    </label>
                                </#list>
                            </@dictionary>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-md-12 col-lg-12" >
                <div class="form-group" >
                    <label  class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">关注潜能开发：</label>
                    <input type="hidden"  name="potencyExploit">
                    <div>
                        <div class="col-xs-10  nomargin-bottom " style="padding-left: 2px!important;line-height: 28px">
                            <@dictionary groupCode="potencyExploit";dics>
                                <#list dics as dic>
                                    <label>
                                        <label>
                                            <input type="checkbox" name="potencyExploitChk"  class="chk" value="${dic.code}" style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" >
                                        </label>
                                        <label style="margin-right: 10px" >${dic.value}</label>
                                    </label>
                                </#list>
                            </@dictionary>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-md-12 col-lg-12" >
                <div class="form-group" >
                    <label  class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">感兴趣的课程：</label>
                    <input type="hidden"  name="interstedCourse">
                    <div>
                        <div class="col-xs-10  nomargin-bottom " style="padding-left: 2px!important;line-height: 28px">
                            <@dictionary groupCode="interstedCourse";dics>
                                <#list dics as dic>
                                    <label>
                                        <label>
                                            <input type="checkbox" name="interstedCourseChk" class="chk" value="${dic.code}" style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" >
                                        </label>
                                        <label style="margin-right: 10px" >${dic.value}</label>
                                    </label>
                                </#list>
                            </@dictionary>
                        </div>
                    </div>
                    <input type="hidden" name="interstedCourseRemark"/>
                </div>
            </div>

            <!--<#if (true && editModel=='add')||(true && editModel=='edit')>-->
            <!--<div class="col-xs-12 col-md-12 col-lg-12 nopadding-left nopadding-right" >-->
            <!--<div class="form-group">-->
            <!--<label-->
            <!--class="col-sm-2 col-sm-offset-2 control-label no-padding-right">所属城区：</label>-->
            <!--<div class="col-sm-6">-->
            <!--<select name="addressProvince" class="addressProvince col-sm-4">-->
            <!--</select>-->

            <!--<select name="addressCity" class="addressCity col-sm-4">-->
            <!--</select>-->
            <!--<select name="addressRegion" class="addressRegion col-sm-4">-->
            <!--</select>-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
            <!--</#if>-->

            <input type="hidden" name="pertainRelationList">
            <div class="row bootbox-footer" style="height: 50px;padding-top: 10px;background-color: #f5f5f5;margin-right: -15px;border-bottom-right-radius: 5px!important;border-bottom-left-radius: 5px!important;clear: both;">
                <button style="width: 80px;margin-right:20px;float: right;" type="submit" class="btn btn-blue submitBtn"
                        id="editFormSubmitBtn_${serializeNum}" onclick="showJoinPerlation(this)">提交
                </button>
            </div>
        </div>
    </form>
</div>

<script src="assets/js/validation/bootstrapValidator_init.js"></script>
<script>
    /**
     * 获取省
     */
    $(function () {
        ajaxRequest("sysCitysController/provinceList.do", null, function (result) {
            var data = result.data;
            var arr = ['<option value="0">请选择</option>'];
            $.each(data, function (i, t) {
                arr.push('<option value="' + t.id + '">' + t.name + '</option>')
            })
            $(".addressProvince").html(arr.join(''))
        }, function () {
            logger.error("加载省失败!");
        }, "get", "json")
    });

    /**
     * 获取市
     */
    $(".addressProvince").change(function () {
        var nowSelectedProvince = $(this).val();
        ajaxRequest("sysCitysController/getChildrens.do", {
            pId: nowSelectedProvince
        }, function (result) {
            var data = result.data;
            var arr = ['<option value="0">请选择</option>'];
            $.each(data, function (i, t) {
                arr.push('<option value="' + t.id + '">' + t.name + '</option>')
            })
            $(".addressCity").html(arr.join(''))

        }, function () {
            logger.error("加载城市失败!");
        }, "get", "json")
    });


    /**
     * 获取区
     */
    $(".addressCity").change(function () {
        var nowSelectedProvince = $(this).val();
        ajaxRequest("sysCitysController/getChildrens.do", {
            pId: nowSelectedProvince
        }, function (result) {
            var data = result.data;
            var arr = ['<option value="0">请选择</option>'];
            $.each(data, function (i, t) {
                arr.push('<option value="' + t.id + '">' + t.name + '</option>')
            })
            $(".addressRegion").html(arr.join(''))

        }, function () {
            logger.error("加载城区失败!");
        }, "get", "json")
    });


    $(".selectpicker_${serializeNum}").select2();


    var html ='<div class="col-xs-12 col-md-12 col-lg-12 circleHtml newCircleHtml" style="margin-bottom: 15px!important;" >\n' +
        '                                <div class="form-group">\n' +
        '                                    <label for="contactPhone"\n' +
        '                                           class="col-xs-2 control-label  text-align-right" style="padding-right: 7px!important;">\n' +
        '                                        </label>\n' +
        '                                    <div>\n' +
        '                                        <label class="col-xs-10 circleHtmlLabel nomargin-bottom " style="padding-left: 2px!important;">\n' +
        '                                            <label class="nomargin-bottom">\n' +
        '                                                <input required="required" data-bv-message="请填写家长姓名！" maxlength="12" style="width: 200px"\n' +
        '                                                       alt="家长姓名" id="patriarchName" placeholder="家长姓名" type="text"\n' +
        '                                                       title="家长姓名"\n' +
        '                                                       class="form-control patriarchName" value="${data.name}"/>\n' +
        '                                            </label>\n' +
        '                                            <label class="nomargin-bottom">\n' +
        '                                                <select name="affiliationRelation" class="affiliationRelation" style="width: 87px!important;">\n' +
        '                                                    <option >关系</option>\n' +
        '                                                    <@dictionary groupCode="affiliationRelation";dics>\n' +
        '                                                    <#list dics as dic>\n' +
        '                                                        <option value="${dic.code}">${dic.value}</option>\n' +
        '                                                    </#list>\n' +
        '                                                </@dictionary>\n' +
        '                                                </select>\n' +
        '                                            </label>\n' +
        '                                            <label class="nomargin-bottom">\n' +
        '                                                <input required="required" data-bv-message="请填写联系电话！" maxlength="11" style="width: 200px"\n' +
        '                                                       alt="联系电话" id="contactPhone" placeholder="联系电话" type="text"\n' +
        '                                                       title="联系电话"\n' +
        '                                                       class="form-control contactPhone"\n' +
        '                                                       value="${editEntity.contactPhone}"\n' +
        '                                                       onblur="checkPhoneIsSame()" />\n' +
        '                                            </label>\n' +
        '                                            <label class="nomargin-bottom">\n' +
        '                                                <select name="positionType" class="positionType">\n' +
        '                                                    <@dictionary groupCode="positionType";dics>\n' +
        '                                                    <#list dics as dic>\n' +
        '                                                        <option value="${dic.code}">${dic.value}</option>\n' +
        '                                                    </#list>\n' +
        '                                                </@dictionary>\n' +
        '                                                </select>\n' +
        '                                            </label>\n' +
        '                                            <label class="nomargin-bottom padding-left-10">\n' +
        '                                                <div class="circle11" style="width: 22px;height: 22px;background: url(\'assets/img/nav-img/icon_hidden..png\');">\n' +
        '                                                </div>\n' +
        '                                            </label>\n' +
        '                                        </label>\n' +
        '                                    </div>\n' +
        '                                </div>\n' +
        '                            </div>'

    //修改



    function clickAdd() {
        if($('.circleHtml').length == 5){

        } else {
            $('#basicInfo').append(html);
        }
    }

    $("#basicInfo").click(function (e) {
        if (e.target.className == "circle11") {
            $(e.target).parents(".newCircleHtml").remove();
        }
    });

    function showJoinPerlation(that) {
        var arr = $(".circleHtml");
        var obj = [];
        for(var i=0;i<arr.length;i++) {
            var patriarchName = arr.eq(i).find('.circleHtmlLabel').find(".patriarchName").val();
            var affiliationRelation = arr.eq(i).find('.circleHtmlLabel').find(".affiliationRelation").val();
            var contactPhone = arr.eq(i).find('.circleHtmlLabel').find(".contactPhone").val();
            var positionType = arr.eq(i).find('.circleHtmlLabel').find(".positionType").val();
            var person = {};
            person.patriarchName = patriarchName;
            person.affiliationRelation = affiliationRelation;
            person.contactPhone = contactPhone;
            person.positionType = positionType;
            obj.push(person);
        }
        var newObj = JSON.stringify(obj);
        console.log(newObj)
        $("[name='pertainRelationList']").val(newObj);

        //获取客户评估选中值
        var clientAssess = new Array();
        $("[name='clientAssessChk']:checked").map(function (index, chk) {
            var value = chk.value;
            clientAssess.push(value);
        });
        var clientAssessStr = clientAssess.join(",");
        $("[name='clientAssess']").val(clientAssessStr);
        //获取入园方式选中值
        var joinSchoolWay = new Array();
        $("[name='joinSchoolWayChk']:checked").map(function (index, chk) {
            var value = chk.value;
            joinSchoolWay.push(value);
        });
        var joinSchoolWayStr = joinSchoolWay.join(",");
        $("[name='joinSchoolWay']").val(joinSchoolWayStr);
        //获取选择机构元素选中值
        var organizationElement = new Array();
        $("[name='organizationElementChk']:checked").map(function (index, chk) {
            var value = chk.value;
            organizationElement.push(value);
        });
        var organizationElementStr = organizationElement.join(",");
        $("[name='organizationElement']").val(organizationElementStr);
        //获取关注潜能开发选中值
        var potencyExploit = new Array();
        $("[name='potencyExploitChk']:checked").map(function (index, chk) {
            var value = chk.value;
            potencyExploit.push(value);

        });
        var potencyExploitStr = potencyExploit.join(",");
        $("[name='potencyExploit']").val(potencyExploitStr);
        //获取感兴趣的课程选中值
        var interstedCourse = new Array();
        $("[name='interstedCourseChk']:checked").map(function (index, chk) {
            var value = chk.value;
            interstedCourse.push(value);

        });
        var interstedCourseStr = interstedCourse.join(",");
        $("[name='interstedCourse']").val(interstedCourseStr);
    }

    function checkPhoneIsSame(that) {
        var contractPhone = $(that).val();
        var name = $("#name").val();
        ajaxRequest("tssStudentController/checkPhoneIsSame.do", {
            contractPhone:contractPhone,
            name:name
        }, function (result) {
            if (result.resCode == 301) {
                logger.error(result.resMsg);
                $(".contactPhone").val("");
                $(".submitBtn").attr("disabled",true)
            } else {
                $(".submitBtn").attr("disabled",false)
            }
        }, function () {
            logger.error("请求失败!");
        }, "get", "json")
    };



    function inputValueLength(that,type) {
        if(type == 200){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,200}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if(type == 50){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,50}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if(type == 20){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,20}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }
        }
        if(type == 'name'){
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                var v = that.value;
                var reg = /^.{0,12}$/;
                var vv = v.replace(/[^\x00-\xff]/g, "aa");
                if (!reg.test(vv)) {
                    that.value = that.pv ? that.pv : "";
                    logger.error("长度超过限制!");
                } else {
                    that.pv = v;
                }
            }

        }
        if (type == 'englishNumber') {
            if (/[^\a-\z\A-\Z0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0,20));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'telePhone') {
            if (/[^0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 12) {
                    $(that).val(that.value.substring(0,12));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'WeChat') {
            if (/[^\a-\z\A-\Z0-9_]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9_]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0,20));
                    logger.error("长度超过限制!");
                }
            }
        }
    }

    $("#editForm_${serializeNum}").bind("ajaxSubmitCallback", function (event, result) {
        if (result.resCode == 200) {
            bootbox.hideAll();
            logger.info(result.resMsg, true);
            toView('tssStudentController/tssStudentList.do',true,'POST',{pageSize:10})
        } else {
            logger.error(result.resMsg);
        }
    });


//    //弹出层放大缩小
//    function expandView() {
//        $(".modal-dialog").toggleClass("expandView");
//        $(".modal-content").toggleClass("expandView");
//        $(".bootboxs").toggleClass("bootbox");
//    }
</script>
